@extends('admin.master')

@section('top')
<div class="top-breadcrumb pull-left">{!! Breadcrumbs::render('group-create') !!}</div>
@endsection

@section('content')
	{!! Form::open(['route' => 'admin.group.store', 'class'=>'form-horizontal']) !!}
		<table class="table table-form">
			<tbody>
				<tr>
					<th width="80"><span class="control-label"><span class="text-danger require-star">*</span> 名称</span></th>
					<td>{!! Form::text('name', '', ['class'=>'form-control len']) !!}</td>
				</tr>
				<tr>
					<th><span class="control-label">级别</span></th>
					<td>{!! Form::text('level', '', ['class'=>'form-control len100']) !!}</td>
				</tr>
				<tr>
					<th><label class="control-label">权限</label></th>
					<td>
					<ul class="group-auth">
						@if (!empty($tree))
							@foreach($tree as $key=>$value)
							<li>
								<h3>
									<div class="checkbox">
										<label>
											{!! Form::checkbox("menu[]", $value['id'], null) !!}
											<span>{{ $value['name'] }}</span>
										</label>
									</div>
								</h3>
								<ul class="menu-children">
								@if (!empty($value['children']))
									@foreach($value['children'] as $children)
									<li>
										<div class="checkbox">
											<label>
												{!! Form::checkbox("menu[]", $children['id'], null) !!}
												<span>{{ $children['name'] }}</span>
											</label>
										</div>
									</li>
									@endforeach
								@endif
								</ul>
							</li>
							@endforeach
						@endif
					</ul>
					</td>
				</tr>
				<tr>
					<th width="80"><span class="control-label">备注</span></th>
					<td>{!! Form::textarea('remark', '', ['class'=>'form-control len', 'rows'=>3]) !!}</td>
				</tr>
				<tr>
					<td></td>
					<td>{!! Form::submit('提交', ['class'=>'btn btn-primary']) !!}</td>
				</tr>
			</tbody>
		</table>
	{!! Form::close() !!}
@endsection